<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/14 0014
 * Time: 18:20
 */

namespace app\admin\controller;

use think\Controller;
use Session;
class Base extends Controller
{
    function __construct()
    {
        header("Cache-control: private");

        parent::__construct();
    }

    /**
     * 初始化操作
     */
    function initialize()
    {
        //过滤不需要登陆的行为
        if (!in_array($this->request->action(), array('login', 'vertify'))) {
            if (!session::get('admin_id')) {
                $this->redirect('admin/system/login');
            }
        }
    }
}